package Java0106;
public class Java03 {
    public static void main(String[] args) {
        //字符串类
        //了解：字符串的底层是字符数值 char[]
        String s1="abcde";  //['a',’b‘，’c‘，’d‘，’e‘]
        System.out.println(s1);
        //方法1 相等方法
        boolean a ="abc".equals("abc");
        System.out.println(a);
        // 查找
        int b = "abcde".indexOf("cd");
        System.out.println(b);
        // 截取
        String c = "abcde".substring(1, 3);
        System.out.println(c);
        //长度
        int d = "abced".length();
        System.out.println(d);
        //去除两边空格
        String e = "  abc        ".trim();
        System.out.println(e);
        //替换
        String f = "abc123abc123".replace("123", "张三");
        System.out.println(f);
        //根据下标获取数字
        char g = "abcde".charAt(0);
        System.out.println(g);
    }
}
